// 包含多个直接改变state状态的方法的对象

import {REQUESTING, REQ_ERROR, REQ_SUCCESS} from './mutatiosn_types'

export default {
  // 初始显示
  [REQUESTING](state) {
    state.firstSearch = false
    state.loading = true
  },
  // 请求成功时
  [REQ_SUCCESS](state, {users}) {
    state.loading = false
    state.users = users
  },
  // 请求失败时
  [REQ_ERROR](state, {msg}) {
    state.loading = false
    state.errorMsg = msg
  }
}